if (x isin $1) set %.au.cmd X | if (w isin $1) set %.au.cmd W | if (n isin $1) set %.au.cmd n | if (c isin $1) set %.au.cmd c | if (* isin $1) set %.au.cmd * | if (q isin $1) set %.au.q $true
if (f isin $1) { set %.au.cmd f | set %.au.when (activated when you join) } | if (o isin $1) { set %.au.cmd o | set %.au.when (activated when you're opped) } | if (j isin $1) { set %.au.cmd j | set %.au.when (activated when others join) }
if (a isin $1) set %.au.act a | if (p isin $1) set %.au.act p | if (d isin $1) set %.au.act d | if (v isin $1) set %.au.act v | if (e isin $1) set %.au.act e | if (u isin $1) set %.au.act u
if ((%.au.cmd == $null) || (%.au.act == $null)) _quickhelp /auto
if (%.au.cmd == *) {
if (%.au.act == p) { if (%.au.q) return | _error You cannot perform multiple sets of autoevents. }
if (%.au.act == a) { if (%.au.q) return | _error You cannot add an autoevent to multiple types. }
if (%.au.act == u) { if (%.au.q) return | _error Only on-join autoevents have an associated userlevel. }
_allauto %.au.act $2- | return
}
if (($_ischan($2)) || (%.au.cmd == n)) { set %.au.parms $3- | set %.au.chan $2 }
else { set %.au.parms $2- | set %.au.chan all }
set %.au.list $chr(160) ò
if (%.au.cmd isin xw) {
if (%.au.act == a) {
if (%.au.chan == all) { if (%.au.q) return | _error You must give a channel to add an automatic X/W login on. }
if (%.au.parms == $null) { if (%.au.q) return | _error You must give the password to use for the automatic X/W login. }
if ((%pp.net == undernet) && ((X ison %.au.chan) || (W ison %.au.chan))) {
if ((X ison %.au.chan) && ($ial(X!cservice@undernet.org,0) == 1)) set %.au.cmd X
if ((W ison %.au.chan) && ($ial(W!cservice@undernet.org,0) == 1)) set %.au.cmd W
}
if ($_not(%.au.q)) dispa Automatic %.au.cmd login on %col.target $+ %.au.chan $+ added.
set %autoxw. [ $+ [ %.au.chan ] ] %.au.cmd $_pwenc(%.au.parms)
set %autoxw.chans $addtok(%autoxw.chans,%.au.chan,32)
}
elseif (%.au.act == p) {
if (%pp.net != undernet) { if (%.au.q) return | _error You must be connected to UnderNet before you can login to X/W! }
if (%.au.chan == all) {
set %.au.num $_numtok(32,%autoxw.chans)
if (%.au.num == 0) { if (%.au.q) return | _error No automatic X/W logins have been defined! }
if (%.au.chan == all) { if (%.au.q) return | _error You must give a channel to perform autoevents for. }
if (%.au.parms == $null) { if (%.au.q) return | _error You must specify the acting nick for the autoevents. (User who opped you or joined the channel.) }
set %.au.var2 auto- $+ %.au.cmd $+ .all
set %.au.max % [ $+ [ %.au.var2 ] ]
unset %.au.num
if (%.au.max) {
set %.au.num 1
:loop3
set %.au.var3 %.au.var2 $+ . $+ %.au.num
set %.au.cmd % [ $+ [ %.au.var3 ] ]
set %.au.cmd $replace($replace($replace(%.au.cmd,&me&,$me),&nick&,%.au.parms),&chan&,%.au.chan)
%.au.cmd
if ($_vi(.au.num) <= %.au.max) goto loop3
}
set %.au.max % [ $+ [ %.au.var ] ]
if (%.au.max) {
set %.au.num 1
:loop4
set %.au.var2 %.au.var $+ . $+ %.au.num
set %.au.cmd % [ $+ [ %.au.var2 ] ]
set %.au.cmd $replace($replace($replace(%.au.cmd,&me&,$me),&nick&,%.au.parms),&chan&,%.au.chan)
%.au.cmd
if ($_vi(.au.num) <= %.au.max) goto loop4
}
if ($_not(%.au.q)) {
if (%.au.num == $null) dispa No applicable autoevents %.au.when for channel %col.target $+ %.au.chan $+ .
else dispa All autoevents %.au.when for channel %col.target $+ %.au.chan $+ performed.
}
}
elseif (%.au.act == d) {
if (%.au.chan == all) {
set %.au.var auto- $+ %.au.cmd $+ .*
[ unset % $+ [ %.au.var ] ]
if ($_not(%.au.q)) dispa All autoevents %.au.when deleted.
if ($_not(%.au.q)) dispa All autoevents %.au.when deleted for channel %col.target $+ %.au.chan $+ .
}
}
elseif (%.au.act == v) {
open @Info /auto Autoevents %.au.when ( $+ %.au.chan $+ )
set %.au.var2 auto- $+ %.au.cmd $+ .all
dispr @Info These autoevents are performed for any channel: %.au.when
if (% [ $+ [ %.au.var2 ] ] < 1) dispr @Info %.au.list (no global autoevents for this)
else {
set %.au.max % [ $+ [ %.au.var2 ] ]
set %.au.num 1
:loop3
set %.au.var3 %.au.var2 $+ . $+ %.au.num
dispr @Info %.au.list % [ $+ [ %.au.var3 ] ]
if ($_vi(.au.num) <= %.au.max) goto loop3
}
if (%.au.chan == all) {
set %.au.var3 auto- $+ %.au.cmd $+ .chans
set %.au.chans % [ $+ [ %.au.var3 ] ]
set %.au.numc $_numtok(32,%.au.chans)
if (%.au.numc > 0) {
:loop5
set %.au.chan $gettok(%.au.chans,%.au.numc,32)
set %.au.var auto- $+ %.au.cmd $+ . $+ %.au.chan
dispr @Info If done on %col.target $+ %.au.chan $+ , then these autoevents are also run: %.au.when
set %.au.max % [ $+ [ %.au.var ] ]
set %.au.num 1
:loop6
set %.au.var2 %.au.var $+ . $+ %.au.num
dispr @Info %.au.list % [ $+ [ %.au.var2 ] ]
if ($_vi(.au.num) <= %.au.max) goto loop6
if ($_vd(.au.numc) > 0) goto loop5
}
else dispr @Info %.au.list (no autoevents defined for any specific channels)
}
else {
dispr @Info Then, these autoevents are performed specifically for %col.target $+ %.au.chan $+ : %.au.when
if (% [ $+ [ %.au.var ] ] < 1) dispr @Info %.au.list (no autoevents defined for this)
else {
set %.au.max % [ $+ [ %.au.var ] ]
set %.au.num 1
:loop4
set %.au.var2 %.au.var $+ . $+ %.au.num
dispr @Info %.au.list % [ $+ [ %.au.var2 ] ]
if ($_vi(.au.num) <= %.au.max) goto loop4
}
}
}
elseif (%.au.act == e) {
unset %.au.exp
if (%.au.parms == 0) unset %.au.parms
if (%.au.parms == $null) set %.au.exp never
if (%.au.parms == 1) set %.au.exp when you exit mIRC.
if (%.au.parms == 2) set %.au.exp when you disconnect.
if (%.au.parms == 3) set %.au.exp when you part the channel.
if (%.au.exp == $null) { if (%.au.q) return | _error You must give an expiration level. (0, 1, 2, or 3.) }
if (%.au.chan == all) {
set %.au.var auto- $+ %.au.cmd $+ .exp
if ($_not(%.au.q)) {
if (%.au.exp == never) dispa Autoevents %.au.when will not automatically expire. (unless the autoevents for a specific channel have their own expire setting.)
else dispa All autoevents %.au.when will automatically expire %.au.exp (including channel-specific autoevents)
}
}
else {
set %.au.var %.au.var $+ .exp
if ($_not(%.au.q)) {
if (%.au.exp == never) dispa Autoevents %.au.when will not automatically expire for %col.target $+ %.au.chan $+ (global autoevents of this type may have their own expire setting.)
else dispa All autoevents for %col.target $+ %.au.chan $+ %.au.when will automatically expire %.au.exp (global autoevents of this type unaffected.)
}
}
set % [ $+ [ %.au.var ] ] %.au.parms
}
else {
if (%.au.cmd != j) { if (%.au.q) return | _error Only on-join autoevents can have an associated userlevel. }
set %.au.dec %.au.parms
if (%.au.parms == $null) {
if (%.au.chan == all) set %.au.dec %autoj.ulevel
else set %.au.dec $_setting(autoj.ulevel,%.au.chan)
}
unset %.au.how
if (< isin %.au.dec) set %.au.how less than
elseif (> isin %.au.dec) set %.au.how greater than
if (= isin %.au.dec) { if (%.au.how == $null) set %.au.how equal to | else set %.au.how %.au.how or equal to }
if (%.au.how == $null) { set %.au.how greater than or equal to | set %.au.dec <= $+ %.au.dec }
set %.au.num $remove($remove($remove($remove($_s2p(%.au.dec),<),>),=),)
if (%.au.num !isnum) { if (%.au.q) return | _error Illegal level specified- Use a number optionally preceded with >, >=, <, <=, or =. }
if (%.au.parms == $null) {
if (%.au.chan == all) dispa Autoevents (activated when others join) will only activate on users with a level $+ %.au.how $+ %col.info1 $+ %.au.num $+ . (unless a channel's specific autoevents override this setting.)
else dispa Autoevents (activated when others join) for %col.target $+ %.au.chan $+ will only activate on users with a level $+ %.au.how $+ %col.info1 $+ %.au.num $+ .
}
else {
if (%.au.chan == all) {
dispa Autoevents (activated when others join) will now only activate on users with a level $+ %.au.how $+ %col.info1 $+ %.au.num $+ . (unless a channel's specific autoevents override this setting.)
set %autoj.ulevel %.au.dec
}
else {
if (%.au.num == 0) {
dispa Autoevents (activated when others join) for %col.target $+ %.au.chan $+ will now use the default userlevel setting for all on-join autoevents. (type /auto ju to see this setting)
set %autoj.ulevel. [ $+ [ %.au.chan ] ]
}
else {
dispa Autoevents (activated when others join) for %col.target $+ %.au.chan $+ will now only activate on users with a level $+ %.au.how $+ %col.info1 $+ %.au.num $+ .